package org.uim.cricket.analyzer.parsers;

import org.uim.cricket.analyzer.parsers.match.CricketMatchParsable;

public class FetchScoreCardParserBeans extends FetchBeans {

	public static String BEAN_SUFFIX = "-scoreCardFactory";
	public static String BEAN_PREFIX = "";
	
	public FetchScoreCardParserBeans(String theBeanFile) {
		super(theBeanFile);
	}

	public CricketMatchParsable fetchScoreCardBean(String scoreCardType) {
		Object bean = this.fetchBean(BEAN_PREFIX + scoreCardType + BEAN_SUFFIX);
		
		if (bean == null) return null;
		if (!(bean instanceof CricketMatchParsable)) return null;
		return (CricketMatchParsable)bean;
	}
	
}
